#include "ifclient/lua_ifclient_auto.hpp"
#include "ifclient/ifclient.h"
#include "Extends/Extends.h"
#include "scripting/lua-bindings/manual/tolua_fix.h"
#include "scripting/lua-bindings/manual/LuaBasicConversions.h"


int lua_ifclient_Ifclient_getState(lua_State* tolua_S)
{
    int argc = 0;
    Ifclient* cobj = nullptr;
    bool ok  = true;

#if COCOS2D_DEBUG >= 1
    tolua_Error tolua_err;
#endif


#if COCOS2D_DEBUG >= 1
    if (!tolua_isusertype(tolua_S,1,"Ifclient",0,&tolua_err)) goto tolua_lerror;
#endif

    cobj = (Ifclient*)tolua_tousertype(tolua_S,1,0);

#if COCOS2D_DEBUG >= 1
    if (!cobj) 
    {
        tolua_error(tolua_S,"invalid 'cobj' in function 'lua_ifclient_Ifclient_getState'", nullptr);
        return 0;
    }
#endif

    argc = lua_gettop(tolua_S)-1;
    if (argc == 0) 
    {
        if(!ok)
        {
            tolua_error(tolua_S,"invalid arguments in function 'lua_ifclient_Ifclient_getState'", nullptr);
            return 0;
        }
        int ret = cobj->getState();
        tolua_pushnumber(tolua_S,(lua_Number)ret);
        return 1;
    }
    luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "Ifclient:getState",argc, 0);
    return 0;

#if COCOS2D_DEBUG >= 1
    tolua_lerror:
    tolua_error(tolua_S,"#ferror in function 'lua_ifclient_Ifclient_getState'.",&tolua_err);
#endif

    return 0;
}
int lua_ifclient_Ifclient_disconnect(lua_State* tolua_S)
{
    int argc = 0;
    Ifclient* cobj = nullptr;
    bool ok  = true;

#if COCOS2D_DEBUG >= 1
    tolua_Error tolua_err;
#endif


#if COCOS2D_DEBUG >= 1
    if (!tolua_isusertype(tolua_S,1,"Ifclient",0,&tolua_err)) goto tolua_lerror;
#endif

    cobj = (Ifclient*)tolua_tousertype(tolua_S,1,0);

#if COCOS2D_DEBUG >= 1
    if (!cobj) 
    {
        tolua_error(tolua_S,"invalid 'cobj' in function 'lua_ifclient_Ifclient_disconnect'", nullptr);
        return 0;
    }
#endif

    argc = lua_gettop(tolua_S)-1;
    if (argc == 1) 
    {
        bool arg0;

        ok &= luaval_to_boolean(tolua_S, 2, &arg0, "Ifclient:disconnect");
        if(!ok)
        {
            tolua_error(tolua_S,"invalid arguments in function 'lua_ifclient_Ifclient_disconnect'", nullptr);
            return 0;
        }
        cobj->disconnect(arg0);
        lua_settop(tolua_S, 1);
        return 1;
    }
    luaL_error(tolua_S, "%s has wrong boolean of arguments: %d, was expecting %d \n", "Ifclient:disconnect",argc, 1);
    return 0;

#if COCOS2D_DEBUG >= 1
    tolua_lerror:
    tolua_error(tolua_S,"#ferror in function 'lua_ifclient_Ifclient_disconnect'.",&tolua_err);
#endif

    return 0;
}
int lua_ifclient_Ifclient_getLocalUsername(lua_State* tolua_S)
{
    int argc = 0;
    Ifclient* cobj = nullptr;
    bool ok  = true;

#if COCOS2D_DEBUG >= 1
    tolua_Error tolua_err;
#endif


#if COCOS2D_DEBUG >= 1
    if (!tolua_isusertype(tolua_S,1,"Ifclient",0,&tolua_err)) goto tolua_lerror;
#endif

    cobj = (Ifclient*)tolua_tousertype(tolua_S,1,0);

#if COCOS2D_DEBUG >= 1
    if (!cobj) 
    {
        tolua_error(tolua_S,"invalid 'cobj' in function 'lua_ifclient_Ifclient_getLocalUsername'", nullptr);
        return 0;
    }
#endif

    argc = lua_gettop(tolua_S)-1;
    if (argc == 0) 
    {
        if(!ok)
        {
            tolua_error(tolua_S,"invalid arguments in function 'lua_ifclient_Ifclient_getLocalUsername'", nullptr);
            return 0;
        }
        char* ret = cobj->getLocalUsername();
        tolua_pushstring(tolua_S,(const char*)ret);
        return 1;
    }
    luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "Ifclient:getLocalUsername",argc, 0);
    return 0;

#if COCOS2D_DEBUG >= 1
    tolua_lerror:
    tolua_error(tolua_S,"#ferror in function 'lua_ifclient_Ifclient_getLocalUsername'.",&tolua_err);
#endif

    return 0;
}
int lua_ifclient_Ifclient_sendEvent(lua_State* tolua_S)
{
    int argc = 0;
    Ifclient* cobj = nullptr;
    bool ok  = true;

#if COCOS2D_DEBUG >= 1
    tolua_Error tolua_err;
#endif


#if COCOS2D_DEBUG >= 1
    if (!tolua_isusertype(tolua_S,1,"Ifclient",0,&tolua_err)) goto tolua_lerror;
#endif

    cobj = (Ifclient*)tolua_tousertype(tolua_S,1,0);

#if COCOS2D_DEBUG >= 1
    if (!cobj) 
    {
        tolua_error(tolua_S,"invalid 'cobj' in function 'lua_ifclient_Ifclient_sendEvent'", nullptr);
        return 0;
    }
#endif

    argc = lua_gettop(tolua_S)-1;
    if (argc == 7) 
    {
        const char* arg0;
        const char* arg1;
        uint16_t arg2;
        int32_t arg3;
        int arg4;
        const char* arg5;
        int arg6;

        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp, "Ifclient:sendEvent"); arg0 = arg0_tmp.c_str();

        std::string arg1_tmp; ok &= luaval_to_std_string(tolua_S, 3, &arg1_tmp, "Ifclient:sendEvent"); arg1 = arg1_tmp.c_str();

        ok &= luaval_to_uint16(tolua_S, 4,&arg2, "Ifclient:sendEvent");

        ok &= luaval_to_int32(tolua_S, 5,&arg3, "Ifclient:sendEvent");

        ok &= luaval_to_int32(tolua_S, 6,(int *)&arg4, "Ifclient:sendEvent");

        std::string arg5_tmp; ok &= luaval_to_std_string(tolua_S, 7, &arg5_tmp, "Ifclient:sendEvent"); arg5 = arg5_tmp.c_str();

        ok &= luaval_to_int32(tolua_S, 8,(int *)&arg6, "Ifclient:sendEvent");
        if(!ok)
        {
            tolua_error(tolua_S,"invalid arguments in function 'lua_ifclient_Ifclient_sendEvent'", nullptr);
            return 0;
        }
        int ret = cobj->sendEvent(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
        tolua_pushnumber(tolua_S,(lua_Number)ret);
        return 1;
    }
    luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "Ifclient:sendEvent",argc, 7);
    return 0;

#if COCOS2D_DEBUG >= 1
    tolua_lerror:
    tolua_error(tolua_S,"#ferror in function 'lua_ifclient_Ifclient_sendEvent'.",&tolua_err);
#endif

    return 0;
}
int lua_ifclient_Ifclient_getDownloadCount(lua_State* tolua_S)
{
    int argc = 0;
    Ifclient* cobj = nullptr;
    bool ok  = true;

#if COCOS2D_DEBUG >= 1
    tolua_Error tolua_err;
#endif


#if COCOS2D_DEBUG >= 1
    if (!tolua_isusertype(tolua_S,1,"Ifclient",0,&tolua_err)) goto tolua_lerror;
#endif

    cobj = (Ifclient*)tolua_tousertype(tolua_S,1,0);

#if COCOS2D_DEBUG >= 1
    if (!cobj) 
    {
        tolua_error(tolua_S,"invalid 'cobj' in function 'lua_ifclient_Ifclient_getDownloadCount'", nullptr);
        return 0;
    }
#endif

    argc = lua_gettop(tolua_S)-1;
    if (argc == 0) 
    {
        if(!ok)
        {
            tolua_error(tolua_S,"invalid arguments in function 'lua_ifclient_Ifclient_getDownloadCount'", nullptr);
            return 0;
        }
        int ret = cobj->getDownloadCount();
        tolua_pushnumber(tolua_S,(lua_Number)ret);
        return 1;
    }
    luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "Ifclient:getDownloadCount",argc, 0);
    return 0;

#if COCOS2D_DEBUG >= 1
    tolua_lerror:
    tolua_error(tolua_S,"#ferror in function 'lua_ifclient_Ifclient_getDownloadCount'.",&tolua_err);
#endif

    return 0;
}
int lua_ifclient_Ifclient_getUploadCount(lua_State* tolua_S)
{
    int argc = 0;
    Ifclient* cobj = nullptr;
    bool ok  = true;

#if COCOS2D_DEBUG >= 1
    tolua_Error tolua_err;
#endif


#if COCOS2D_DEBUG >= 1
    if (!tolua_isusertype(tolua_S,1,"Ifclient",0,&tolua_err)) goto tolua_lerror;
#endif

    cobj = (Ifclient*)tolua_tousertype(tolua_S,1,0);

#if COCOS2D_DEBUG >= 1
    if (!cobj) 
    {
        tolua_error(tolua_S,"invalid 'cobj' in function 'lua_ifclient_Ifclient_getUploadCount'", nullptr);
        return 0;
    }
#endif

    argc = lua_gettop(tolua_S)-1;
    if (argc == 0) 
    {
        if(!ok)
        {
            tolua_error(tolua_S,"invalid arguments in function 'lua_ifclient_Ifclient_getUploadCount'", nullptr);
            return 0;
        }
        int ret = cobj->getUploadCount();
        tolua_pushnumber(tolua_S,(lua_Number)ret);
        return 1;
    }
    luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "Ifclient:getUploadCount",argc, 0);
    return 0;

#if COCOS2D_DEBUG >= 1
    tolua_lerror:
    tolua_error(tolua_S,"#ferror in function 'lua_ifclient_Ifclient_getUploadCount'.",&tolua_err);
#endif

    return 0;
}
int lua_ifclient_Ifclient_getMsDelay(lua_State* tolua_S)
{
    int argc = 0;
    Ifclient* cobj = nullptr;
    bool ok  = true;

#if COCOS2D_DEBUG >= 1
    tolua_Error tolua_err;
#endif


#if COCOS2D_DEBUG >= 1
    if (!tolua_isusertype(tolua_S,1,"Ifclient",0,&tolua_err)) goto tolua_lerror;
#endif

    cobj = (Ifclient*)tolua_tousertype(tolua_S,1,0);

#if COCOS2D_DEBUG >= 1
    if (!cobj) 
    {
        tolua_error(tolua_S,"invalid 'cobj' in function 'lua_ifclient_Ifclient_getMsDelay'", nullptr);
        return 0;
    }
#endif

    argc = lua_gettop(tolua_S)-1;
    if (argc == 0) 
    {
        if(!ok)
        {
            tolua_error(tolua_S,"invalid arguments in function 'lua_ifclient_Ifclient_getMsDelay'", nullptr);
            return 0;
        }
        int ret = cobj->getMsDelay();
        tolua_pushnumber(tolua_S,(lua_Number)ret);
        return 1;
    }
    luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "Ifclient:getMsDelay",argc, 0);
    return 0;

#if COCOS2D_DEBUG >= 1
    tolua_lerror:
    tolua_error(tolua_S,"#ferror in function 'lua_ifclient_Ifclient_getMsDelay'.",&tolua_err);
#endif

    return 0;
}

int lua_ifclient_Ifclient_sendMessage(lua_State* tolua_S)
{
    int argc = 0;
    Ifclient* cobj = nullptr;
    bool ok  = true;

#if COCOS2D_DEBUG >= 1
    tolua_Error tolua_err;
#endif


#if COCOS2D_DEBUG >= 1
    if (!tolua_isusertype(tolua_S,1,"Ifclient",0,&tolua_err)) goto tolua_lerror;
#endif

    cobj = (Ifclient*)tolua_tousertype(tolua_S,1,0);

#if COCOS2D_DEBUG >= 1
    if (!cobj) 
    {
        tolua_error(tolua_S,"invalid 'cobj' in function 'lua_ifclient_Ifclient_sendMessage'", nullptr);
        return 0;
    }
#endif

    argc = lua_gettop(tolua_S)-1;
    if (argc == 5) 
    {
        const char* arg0;
        const char* arg1;
        const char* arg2;
        const char* arg3;
        int arg4;

        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp, "Ifclient:sendMessage"); arg0 = arg0_tmp.c_str();

        std::string arg1_tmp; ok &= luaval_to_std_string(tolua_S, 3, &arg1_tmp, "Ifclient:sendMessage"); arg1 = arg1_tmp.c_str();

        std::string arg2_tmp; ok &= luaval_to_std_string(tolua_S, 4, &arg2_tmp, "Ifclient:sendMessage"); arg2 = arg2_tmp.c_str();

        std::string arg3_tmp; ok &= luaval_to_std_string(tolua_S, 5, &arg3_tmp, "Ifclient:sendMessage"); arg3 = arg3_tmp.c_str();

        ok &= luaval_to_int32(tolua_S, 6,(int *)&arg4, "Ifclient:sendMessage");
        if(!ok)
        {
            tolua_error(tolua_S,"invalid arguments in function 'lua_ifclient_Ifclient_sendMessage'", nullptr);
            return 0;
        }
        int ret = cobj->sendMessage(arg0, arg1, arg2, arg3, arg4);
        tolua_pushnumber(tolua_S,(lua_Number)ret);
        return 1;
    }
    luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "Ifclient:sendMessage",argc, 5);
    return 0;

#if COCOS2D_DEBUG >= 1
    tolua_lerror:
    tolua_error(tolua_S,"#ferror in function 'lua_ifclient_Ifclient_sendMessage'.",&tolua_err);
#endif

    return 0;
}
int lua_ifclient_Ifclient_connect(lua_State* tolua_S)
{
    int argc = 0;
    Ifclient* cobj = nullptr;
    bool ok  = true;

#if COCOS2D_DEBUG >= 1
    tolua_Error tolua_err;
#endif


#if COCOS2D_DEBUG >= 1
    if (!tolua_isusertype(tolua_S,1,"Ifclient",0,&tolua_err)) goto tolua_lerror;
#endif

    cobj = (Ifclient*)tolua_tousertype(tolua_S,1,0);

#if COCOS2D_DEBUG >= 1
    if (!cobj) 
    {
        tolua_error(tolua_S,"invalid 'cobj' in function 'lua_ifclient_Ifclient_connect'", nullptr);
        return 0;
    }
#endif

    argc = lua_gettop(tolua_S)-1;
    if (argc == 1) 
    {
        int arg0;

        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "Ifclient:connect");
        if(!ok)
        {
            tolua_error(tolua_S,"invalid arguments in function 'lua_ifclient_Ifclient_connect'", nullptr);
            return 0;
        }
        cobj->connect(arg0);
        lua_settop(tolua_S, 1);
        return 1;
    }
    luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "Ifclient:connect",argc, 1);
    return 0;

#if COCOS2D_DEBUG >= 1
    tolua_lerror:
    tolua_error(tolua_S,"#ferror in function 'lua_ifclient_Ifclient_connect'.",&tolua_err);
#endif

    return 0;
}
int lua_ifclient_Ifclient_getServerName(lua_State* tolua_S)
{
    int argc = 0;
    Ifclient* cobj = nullptr;
    bool ok  = true;

#if COCOS2D_DEBUG >= 1
    tolua_Error tolua_err;
#endif


#if COCOS2D_DEBUG >= 1
    if (!tolua_isusertype(tolua_S,1,"Ifclient",0,&tolua_err)) goto tolua_lerror;
#endif

    cobj = (Ifclient*)tolua_tousertype(tolua_S,1,0);

#if COCOS2D_DEBUG >= 1
    if (!cobj) 
    {
        tolua_error(tolua_S,"invalid 'cobj' in function 'lua_ifclient_Ifclient_getServerName'", nullptr);
        return 0;
    }
#endif

    argc = lua_gettop(tolua_S)-1;
    if (argc == 0) 
    {
        if(!ok)
        {
            tolua_error(tolua_S,"invalid arguments in function 'lua_ifclient_Ifclient_getServerName'", nullptr);
            return 0;
        }
        char* ret = cobj->getServerName();
        tolua_pushstring(tolua_S,(const char*)ret);
        return 1;
    }
    luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "Ifclient:getServerName",argc, 0);
    return 0;

#if COCOS2D_DEBUG >= 1
    tolua_lerror:
    tolua_error(tolua_S,"#ferror in function 'lua_ifclient_Ifclient_getServerName'.",&tolua_err);
#endif

    return 0;
}
int lua_ifclient_Ifclient_getPort(lua_State* tolua_S)
{
    int argc = 0;
    Ifclient* cobj = nullptr;
    bool ok  = true;

#if COCOS2D_DEBUG >= 1
    tolua_Error tolua_err;
#endif


#if COCOS2D_DEBUG >= 1
    if (!tolua_isusertype(tolua_S,1,"Ifclient",0,&tolua_err)) goto tolua_lerror;
#endif

    cobj = (Ifclient*)tolua_tousertype(tolua_S,1,0);

#if COCOS2D_DEBUG >= 1
    if (!cobj) 
    {
        tolua_error(tolua_S,"invalid 'cobj' in function 'lua_ifclient_Ifclient_getPort'", nullptr);
        return 0;
    }
#endif

    argc = lua_gettop(tolua_S)-1;
    if (argc == 0) 
    {
        if(!ok)
        {
            tolua_error(tolua_S,"invalid arguments in function 'lua_ifclient_Ifclient_getPort'", nullptr);
            return 0;
        }
        unsigned short ret = cobj->getPort();
        tolua_pushnumber(tolua_S,(lua_Number)ret);
        return 1;
    }
    luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "Ifclient:getPort",argc, 0);
    return 0;

#if COCOS2D_DEBUG >= 1
    tolua_lerror:
    tolua_error(tolua_S,"#ferror in function 'lua_ifclient_Ifclient_getPort'.",&tolua_err);
#endif

    return 0;
}
int lua_ifclient_Ifclient_addFunction(lua_State* tolua_S)
{
    int argc = 0;
    Ifclient* cobj = nullptr;
    bool ok  = true;

#if COCOS2D_DEBUG >= 1
    tolua_Error tolua_err;
#endif


#if COCOS2D_DEBUG >= 1
    if (!tolua_isusertype(tolua_S,1,"Ifclient",0,&tolua_err)) goto tolua_lerror;
#endif

    cobj = (Ifclient*)tolua_tousertype(tolua_S,1,0);

#if COCOS2D_DEBUG >= 1
    if (!cobj) 
    {
        tolua_error(tolua_S,"invalid 'cobj' in function 'lua_ifclient_Ifclient_addFunction'", nullptr);
        return 0;
    }
#endif

    argc = lua_gettop(tolua_S)-1;
    if (argc == 1) 
    {
        std::function<void ()> arg0;

        do {
			// Lambda binding for lua is not supported.
			assert(false);
		} while(0)
		;
        if(!ok)
        {
            tolua_error(tolua_S,"invalid arguments in function 'lua_ifclient_Ifclient_addFunction'", nullptr);
            return 0;
        }
        cobj->addFunction(arg0);
        lua_settop(tolua_S, 1);
        return 1;
    }
    luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "Ifclient:addFunction",argc, 1);
    return 0;

#if COCOS2D_DEBUG >= 1
    tolua_lerror:
    tolua_error(tolua_S,"#ferror in function 'lua_ifclient_Ifclient_addFunction'.",&tolua_err);
#endif

    return 0;
}
int lua_ifclient_Ifclient_getServerHost(lua_State* tolua_S)
{
    int argc = 0;
    Ifclient* cobj = nullptr;
    bool ok  = true;

#if COCOS2D_DEBUG >= 1
    tolua_Error tolua_err;
#endif


#if COCOS2D_DEBUG >= 1
    if (!tolua_isusertype(tolua_S,1,"Ifclient",0,&tolua_err)) goto tolua_lerror;
#endif

    cobj = (Ifclient*)tolua_tousertype(tolua_S,1,0);

#if COCOS2D_DEBUG >= 1
    if (!cobj) 
    {
        tolua_error(tolua_S,"invalid 'cobj' in function 'lua_ifclient_Ifclient_getServerHost'", nullptr);
        return 0;
    }
#endif

    argc = lua_gettop(tolua_S)-1;
    if (argc == 0) 
    {
        if(!ok)
        {
            tolua_error(tolua_S,"invalid arguments in function 'lua_ifclient_Ifclient_getServerHost'", nullptr);
            return 0;
        }
        char* ret = cobj->getServerHost();
        tolua_pushstring(tolua_S,(const char*)ret);
        return 1;
    }
    luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "Ifclient:getServerHost",argc, 0);
    return 0;

#if COCOS2D_DEBUG >= 1
    tolua_lerror:
    tolua_error(tolua_S,"#ferror in function 'lua_ifclient_Ifclient_getServerHost'.",&tolua_err);
#endif

    return 0;
}
int lua_ifclient_Ifclient_create(lua_State* tolua_S)
{
    int argc = 0;
    bool ok  = true;

#if COCOS2D_DEBUG >= 1
    tolua_Error tolua_err;
#endif

#if COCOS2D_DEBUG >= 1
    if (!tolua_isusertable(tolua_S,1,"Ifclient",0,&tolua_err)) goto tolua_lerror;
#endif

    argc = lua_gettop(tolua_S) - 1;

    if (argc == 6)
    {
        const char* arg0;
        unsigned short arg1;
        const char* arg2;
        const char* arg3;
        int arg4;
        int arg5;
        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp, "Ifclient:create"); arg0 = arg0_tmp.c_str();
        ok &= luaval_to_ushort(tolua_S, 3, &arg1, "Ifclient:create");
        std::string arg2_tmp; ok &= luaval_to_std_string(tolua_S, 4, &arg2_tmp, "Ifclient:create"); arg2 = arg2_tmp.c_str();
        std::string arg3_tmp; ok &= luaval_to_std_string(tolua_S, 5, &arg3_tmp, "Ifclient:create"); arg3 = arg3_tmp.c_str();
        ok &= luaval_to_int32(tolua_S, 6,(int *)&arg4, "Ifclient:create");
        ok &= luaval_to_int32(tolua_S, 7,(int *)&arg5, "Ifclient:create");
        if(!ok)
        {
            tolua_error(tolua_S,"invalid arguments in function 'lua_ifclient_Ifclient_create'", nullptr);
            return 0;
        }
        Ifclient* ret = Ifclient::create(arg0, arg1, arg2, arg3, arg4, arg5);
        object_to_luaval<Ifclient>(tolua_S, "Ifclient",(Ifclient*)ret);
        return 1;
    }
    luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "Ifclient:create",argc, 6);
    return 0;
#if COCOS2D_DEBUG >= 1
    tolua_lerror:
    tolua_error(tolua_S,"#ferror in function 'lua_ifclient_Ifclient_create'.",&tolua_err);
#endif
    return 0;
}
int lua_ifclient_Ifclient_constructor(lua_State* tolua_S)
{
    int argc = 0;
    Ifclient* cobj = nullptr;
    bool ok  = true;

#if COCOS2D_DEBUG >= 1
    tolua_Error tolua_err;
#endif



    argc = lua_gettop(tolua_S)-1;
    if (argc == 6) 
    {
        const char* arg0;
        unsigned short arg1;
        const char* arg2;
        const char* arg3;
        int arg4;
        int arg5;

        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp, "Ifclient:Ifclient"); arg0 = arg0_tmp.c_str();

        ok &= luaval_to_ushort(tolua_S, 3, &arg1, "Ifclient:Ifclient");

        std::string arg2_tmp; ok &= luaval_to_std_string(tolua_S, 4, &arg2_tmp, "Ifclient:Ifclient"); arg2 = arg2_tmp.c_str();

        std::string arg3_tmp; ok &= luaval_to_std_string(tolua_S, 5, &arg3_tmp, "Ifclient:Ifclient"); arg3 = arg3_tmp.c_str();

        ok &= luaval_to_int32(tolua_S, 6,(int *)&arg4, "Ifclient:Ifclient");

        ok &= luaval_to_int32(tolua_S, 7,(int *)&arg5, "Ifclient:Ifclient");
        if(!ok)
        {
            tolua_error(tolua_S,"invalid arguments in function 'lua_ifclient_Ifclient_constructor'", nullptr);
            return 0;
        }
        cobj = new Ifclient(arg0, arg1, arg2, arg3, arg4, arg5);
        cobj->autorelease();
        int ID =  (int)cobj->_ID ;
        int* luaID =  &cobj->_luaID ;
        toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,"Ifclient");
        return 1;
    }
    luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "Ifclient:Ifclient",argc, 6);
    return 0;

#if COCOS2D_DEBUG >= 1
    tolua_error(tolua_S,"#ferror in function 'lua_ifclient_Ifclient_constructor'.",&tolua_err);
#endif

    return 0;
}

static int lua_ifclient_Ifclient_finalize(lua_State* tolua_S)
{
    printf("luabindings: finalizing LUA object (Ifclient)");
    return 0;
}

int lua_ifclient_Ifclient_setCallback(lua_State* tolua_S)
{
     int argc = 0;
    Ifclient* cobj = nullptr;
    bool ok  = true;

#if COCOS2D_DEBUG >= 1
    tolua_Error tolua_err;
#endif


#if COCOS2D_DEBUG >= 1
    if (!tolua_isusertype(tolua_S,1,"Ifclient",0,&tolua_err)) goto tolua_lerror;
#endif

    cobj = (Ifclient*)tolua_tousertype(tolua_S,1,0);

#if COCOS2D_DEBUG >= 1
    if (!cobj) 
    {
        tolua_error(tolua_S,"invalid 'cobj' in function 'lua_ifclient_Ifclient_setCallback'", nullptr);
        return 0;
    }
#endif

    argc = lua_gettop(tolua_S) - 1;

    if (argc == 5)
    {
#if COCOS2D_DEBUG >= 1
        if (!toluafix_isfunction(tolua_S, 2, "LUA_FUNCTION", 0, &tolua_err))
            goto tolua_lerror;
        if (!toluafix_isfunction(tolua_S, 3, "LUA_FUNCTION", 0, &tolua_err))
            goto tolua_lerror;
        if (!toluafix_isfunction(tolua_S, 4, "LUA_FUNCTION", 0, &tolua_err))
            goto tolua_lerror;
        if (!toluafix_isfunction(tolua_S, 5, "LUA_FUNCTION", 0, &tolua_err))
            goto tolua_lerror;
        if (!toluafix_isfunction(tolua_S, 6, "LUA_FUNCTION", 0, &tolua_err))
            goto tolua_lerror;
#endif
        int arg0;
        int arg1;
        int arg2;
        int arg3;
        int arg4;
        arg0 = toluafix_ref_function(tolua_S, 2, 0);
        arg1 = toluafix_ref_function(tolua_S, 3, 0);
        arg2 = toluafix_ref_function(tolua_S, 4, 0);
        arg3 = toluafix_ref_function(tolua_S, 5, 0);        
        arg4 = toluafix_ref_function(tolua_S, 6, 0);        
        cobj->setCallback(arg0, arg1, arg2, arg3, arg4);
        lua_settop(tolua_S, 1);
        return 1;
    }
    luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "Ifclient:setCallback", argc, 4);
    return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
    tolua_error(tolua_S, "#ferror in function 'lua_ifclient_Ifclient_setCallback'.", &tolua_err);
#endif
    return 0;
}

int lua_register_ifclient_Ifclient(lua_State* tolua_S)
{
    tolua_usertype(tolua_S,"Ifclient");
    tolua_cclass(tolua_S,"Ifclient","Ifclient","cc.Ref",nullptr);

    tolua_beginmodule(tolua_S,"Ifclient");
        tolua_function(tolua_S,"new",lua_ifclient_Ifclient_constructor);
        tolua_function(tolua_S,"getState",lua_ifclient_Ifclient_getState);
        tolua_function(tolua_S,"disconnect",lua_ifclient_Ifclient_disconnect);
        tolua_function(tolua_S,"getLocalUsername",lua_ifclient_Ifclient_getLocalUsername);
        tolua_function(tolua_S,"sendEvent",lua_ifclient_Ifclient_sendEvent);
        tolua_function(tolua_S,"getDownloadCount",lua_ifclient_Ifclient_getDownloadCount);
        tolua_function(tolua_S,"getUploadCount",lua_ifclient_Ifclient_getUploadCount);
        tolua_function(tolua_S,"getMsDelay",lua_ifclient_Ifclient_getMsDelay);
        tolua_function(tolua_S,"setCallback",lua_ifclient_Ifclient_setCallback);
        tolua_function(tolua_S,"sendMessage",lua_ifclient_Ifclient_sendMessage);
        tolua_function(tolua_S,"connect",lua_ifclient_Ifclient_connect);
        tolua_function(tolua_S,"getServerName",lua_ifclient_Ifclient_getServerName);
        tolua_function(tolua_S,"getPort",lua_ifclient_Ifclient_getPort);
        tolua_function(tolua_S,"addFunction",lua_ifclient_Ifclient_addFunction);
        tolua_function(tolua_S,"getServerHost",lua_ifclient_Ifclient_getServerHost);
        tolua_function(tolua_S,"create", lua_ifclient_Ifclient_create);
    tolua_endmodule(tolua_S);
    std::string typeName = typeid(Ifclient).name();
    g_luaType[typeName] = "Ifclient";
    g_typeCast["Ifclient"] = "Ifclient";
    return 1;
}
TOLUA_API int register_all_ifclient(lua_State* tolua_S)
{
	tolua_open(tolua_S);
	
	tolua_module(tolua_S,"wyf",0);
	tolua_beginmodule(tolua_S,"wyf");

	lua_register_ifclient_Ifclient(tolua_S);

	tolua_endmodule(tolua_S);
	return 1;
}

